﻿/*
 * Crée par SharpDevelop.
 * Utilisateur: cuicui
 * Date: 19/02/2012
 * Heure: 16:26
 * 
 * Pour changer ce modèle utiliser Outils | Options | Codage | Editer les en-têtes standards.
 */
using System;
using System.Drawing;
using System.Windows.Forms;

namespace DBFileExplorer
{
	/// <summary>
	/// Description of OptionsDlg.
	/// </summary>
	public partial class OptionsDlg : Form
	{
		private MainForm ptrMainForm;
		public OptionsDlg(MainForm mf, OptionsPropertyGridClass optionParams)
		{
			InitializeComponent();
			
			if ( mf != null ) ptrMainForm = mf;
			
			mf.LoadLastConfigForOptions();
			
			if ( optionParams != null ) this.propertyGrid1.SelectedObject = optionParams;
			else Close();
		}
		
		void ApplyBtnClick(object sender, EventArgs e)
		{
			if ( ptrMainForm != null ) 
				ptrMainForm.SaveConfigForOptions();
			Close();
		}
		
		void CloseBtnClick(object sender, EventArgs e)
		{
			Close();
		}
	}
}
